package com.aimuceliang.aimuceliang.ui.adapter;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * ImagePagerAdapter
 */
public abstract class ImagePagerAdapter<T> extends PagerAdapter {


    private int size;

    public ImagePagerAdapter(List<T> imageIdList) {
        this.size = imageIdList.size();
    }

    @Override
    public int getCount() {
        return size;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        return initItem(container, position);
    }

    public abstract Object initItem(ViewGroup container, int position);

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return object == view;
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
    }


}